<?php
	abstract class Repository
	{
		protected $ModelClassName;
		protected $TableName;
		protected $PrimaryKey;
		
		protected $ColumnMappings;
		
		function __construct()
		{
			$className = get_class($this);
			$className = substr($className, 0, strLen($className) - strlen('Repository'));
			
			$this->ModelClassName = $className;
			$this->TableName = $className.'s';
			$this->PrimaryKey = $className.'_Id';
			
			$this->Map();
			
			print_r($this);
		}
		
		protected function Map()
		{
			$this->ColumnMappings = array(
				$this->PrimaryKey => 'Id'
			);
			
		}
		
		protected function Connection()
		{
			return Database::Instance();
		}
		
		function SelectById($id)
		{
			$query = "SELECT * FROM `$this->TableName` WHERE `$this->PrimaryKey` = ?";
			print($query);
		}
		
	}

?>